import { defineStore } from 'pinia';
interface EnergyType{
    works: string,
    type: string,
    date: Date,
    supply: number,
    elect: number,
    voltage: number,
    power: number,
    factor:number,
    quantity:number,
    objectId:string,
}
interface EnergyStateType {
    energyData: Array<EnergyType>;
  }
export const useEnergy = defineStore("obserState",{
    state:():EnergyStateType=>({
        energyData:[],
    }),
    actions:{
        //更新数据
        obserUpdate(obj:EnergyType,index:number){
            this.energyData.splice(index,1,obj)
        }
    }
})